import 'package:flutter/cupertino.dart';

class CountProvider extends InheritedWidget {
  final int count;
  final VoidCallback onIncremwnt;

  const CountProvider({
    super.key,
    required this.count,
    required this.onIncremwnt,
    required super.child,
  });

  static CountProvider of(BuildContext context) {
    return context.dependOnInheritedWidgetOfExactType<CountProvider>()!;
  }

  @override
  bool updateShouldNotify(CountProvider old) => count != old.count;
}
